<?php

class Application_Form_Element_CategorySelect extends Zend_Form_Element_Select {
	
	public function init() {
		
		$categMapper = new Application_Model_CategoryMapper();
		$this->addMultiOption(0, 'Categoria...');
		
		foreach ($categMapper->fetchAll() as $categ) {
			$this->addMultiOption($categ->getId_category(), $categ->getName());
		}
		
		$this->setLabel('Categoria:');
		$this->setName('id_category');
	}
}